<html>
<head><meta charset="utf-8"><title>issue-52533-region-err-fully-elaborated-types · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html">issue-52533-region-err-fully-elaborated-types</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="130138720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130138720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130138720">(Jul 23 2018 at 09:34)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> figured I'd spin off a new topic for <a href="https://github.com/rust-lang/rust/issues/52533" target="_blank" title="https://github.com/rust-lang/rust/issues/52533">#52533</a> since the other PR got merged yesterday.</p>



<a name="130141982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130141982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130141982">(Jul 23 2018 at 11:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Currently have it outputting the following, will open a WIP PR once I've run tests and see what else it affects:</p>
<div class="codehilite"><pre><span></span>warning: not reporting region error due to nll
  --&gt; src/test/ui/issue-52533.rs:15:16
   |
15 |     foo(|a, b| b)
   |                ^

warning: unused variable: `a`
  --&gt; src/test/ui/issue-52533.rs:15:10
   |
15 |     foo(|a, b| b)
   |          ^ help: consider using `_a` instead
   |
   = note: #[warn(unused_variables)] on by default

error: unsatisfied lifetime constraints
  --&gt; src/test/ui/issue-52533.rs:15:16
   |
15 |     foo(|a, b| b)
   |           -  - ^ closure was supposed to return data with lifetime `&#39;1` but it is returning data with lifetime `&#39;2`
   |           |  |
   |           |  has type `&amp;&#39;1 u32`
   |           has type `&amp;&#39;2 u32`

error: aborting due to previous error
</pre></div>


<p>I have no idea why the span is off-by-one.</p>



<a name="130143514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130143514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130143514">(Jul 23 2018 at 11:43)</a>:</h4>
<p>Fixed the span issue but found that this solution fails on some more complex cases, will keep at it.</p>



<a name="130149614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149614">(Jul 23 2018 at 13:54)</a>:</h4>
<p>looks nice</p>



<a name="130149625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149625">(Jul 23 2018 at 13:54)</a>:</h4>
<p>The approach I was taking probably won't work.</p>



<a name="130149630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149630">(Jul 23 2018 at 13:54)</a>:</h4>
<p>How did you intend for those elaborated types to be constructed?</p>



<a name="130149745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149745">(Jul 23 2018 at 13:57)</a>:</h4>
<p>The approach I used above called <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/infer/struct.InferCtxt.html?search=#method.extract_type_name" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/infer/struct.InferCtxt.html?search=#method.extract_type_name">extract_type_name</a> and then looked through the string for <code>&amp;</code> and added our synthesized region names. That doesn't work when <code>extract_type_name</code> has <code>'_#2r</code> types of regions in it. I could work around that with some string manipulation but that seems like a poor solution. </p>
<p>Haven't worked out how to do it properly yet.</p>



<a name="130149841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149841">(Jul 23 2018 at 13:59)</a>:</h4>
<p>I wasn't sure what I wanted to do</p>



<a name="130149844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149844">(Jul 23 2018 at 13:59)</a>:</h4>
<p>one thing I was considering</p>



<a name="130149847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149847">(Jul 23 2018 at 13:59)</a>:</h4>
<p>is extracting the <code>ppaux</code> code</p>



<a name="130149850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149850">(Jul 23 2018 at 13:59)</a>:</h4>
<p>which is currently a total mess</p>



<a name="130149858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149858">(Jul 23 2018 at 13:59)</a>:</h4>
<p>and, in this version, allow it to be characterized by some helper fns</p>



<a name="130149861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149861">(Jul 23 2018 at 13:59)</a>:</h4>
<p>for example "how do I print this region"</p>



<a name="130149866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149866">(Jul 23 2018 at 13:59)</a>:</h4>
<p>I had been looking at that, wasn't sure if that was worth doing.</p>



<a name="130149916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149916">(Jul 23 2018 at 14:00)</a>:</h4>
<p>one problem with my idea is that it will be very tempting to try and cleanup the code</p>



<a name="130149925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149925">(Jul 23 2018 at 14:00)</a>:</h4>
<p>and that is a rat hole that never seems to work ;)</p>



<a name="130149932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149932">(Jul 23 2018 at 14:00)</a>:</h4>
<p>otoh hacking in "yet another random helper thing" might .. be one too many</p>



<a name="130149947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149947">(Jul 23 2018 at 14:00)</a>:</h4>
<p>but basically there are two approaches I guess:</p>



<a name="130149956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149956">(Jul 23 2018 at 14:01)</a>:</h4>
<p>we can generate a type that includes regions</p>



<a name="130149976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149976">(Jul 23 2018 at 14:01)</a>:</h4>
<p>(I'd probably put <code>'1</code> and <code>'2</code> and <code>'_</code> for evrything else)</p>



<a name="130149978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149978">(Jul 23 2018 at 14:01)</a>:</h4>
<p>or we can customize the pretty-printing code</p>



<a name="130149987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149987">(Jul 23 2018 at 14:01)</a>:</h4>
<p>I'm torn on it, but the disadvantage I see of synthesizing an actual type</p>



<a name="130149992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130149992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130149992">(Jul 23 2018 at 14:01)</a>:</h4>
<p>is that it "pollutes" our type system representation</p>



<a name="130150000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130150000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130150000">(Jul 23 2018 at 14:01)</a>:</h4>
<p>it maybe that all we need is a "region callback"?</p>



<a name="130150054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130150054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130150054">(Jul 23 2018 at 14:02)</a>:</h4>
<p>Some way of providing the functions that it uses to generate a new region name for use.</p>



<a name="130150061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130150061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130150061">(Jul 23 2018 at 14:02)</a>:</h4>
<p>(for the pp code, we traditioanlly use thread-local data to configure it)</p>



<a name="130150418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130150418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130150418">(Jul 23 2018 at 14:09)</a>:</h4>
<p>So, I have a slightly yucky, albeit not that long, version that will manipulate the string with <code>&amp;'_#2r</code> type references and replace them with our own.</p>



<a name="130152185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130152185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130152185">(Jul 23 2018 at 14:39)</a>:</h4>
<p>Submitted <a href="https://github.com/rust-lang/rust/issues/52648" target="_blank" title="https://github.com/rust-lang/rust/issues/52648">#52648</a> with what I've got.</p>



<a name="130213230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213230">(Jul 24 2018 at 14:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I can fix that incorrect closure/function labelling in this PR if you'd like (since it is yet to be reviewed and may need work if we don't like the current approach). I'm not sure how to detect whether or not a external region comes from a function or a closure arguments though?</p>



<a name="130213341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213341">(Jul 24 2018 at 14:09)</a>:</h4>
<p>say a bit more? why does it matter if it comes from the arguments per se?</p>



<a name="130213563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213563">(Jul 24 2018 at 14:12)</a>:</h4>
<p>It doesn't need to be arguments, I guess. But the case we're seeing in <code>dyn-trait.rs</code> mentions closures incorrectly. That branch is triggered when the <code>outlived_fr</code> is external (from what I remember) - so it seems like <code>outlived_fr</code> can be external in the case of a captured upvar (what that branch was implemented for) or in the case of a argument from a function (since it is also triggering for <code>dyn-trait.rs</code>).</p>



<a name="130213670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213670">(Jul 24 2018 at 14:14)</a>:</h4>
<p>I think that to decide whether to talk about "closure" vs "fn" we have to check the <code>mir_def_id</code></p>



<a name="130213678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213678">(Jul 24 2018 at 14:14)</a>:</h4>
<p>i.e., the same scenario can occur in either case</p>



<a name="130213686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213686">(Jul 24 2018 at 14:14)</a>:</h4>
<p>in one case, it cannot escape the "closure body"</p>



<a name="130213689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213689">(Jul 24 2018 at 14:14)</a>:</h4>
<p>in one case, it cannot escape the "fn body"</p>



<a name="130213702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213702">(Jul 24 2018 at 14:14)</a>:</h4>
<p>Right, I wasn't sure how I'd find out which of  "closure" or "fn"  to refer to it as.</p>



<a name="130213727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213727">(Jul 24 2018 at 14:15)</a>:</h4>
<p>there is a fn called <code>tcx.is_closure</code> that takes a def-id</p>



<a name="130213730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213730">(Jul 24 2018 at 14:15)</a>:</h4>
<p>I already renamed that function from <code>report_closure_error</code> to <code>report_escaping_data</code> in the PR.</p>



<a name="130213741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130213741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130213741">(Jul 24 2018 at 14:15)</a>:</h4>
<p>Sounds good, I'll quickly make that change.</p>



<a name="130214228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130214228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130214228">(Jul 24 2018 at 14:23)</a>:</h4>
<p>Fixed, PR now has: </p>
<div class="codehilite"><pre><span></span>warning: not reporting region error due to nll
  --&gt; $DIR/dyn-trait.rs:32:16
   |
LL |     static_val(x); //~ ERROR cannot infer
   |                ^

error: borrowed data escapes outside of function
  --&gt; $DIR/dyn-trait.rs:32:5
   |
LL | fn with_dyn_debug_static&lt;&#39;a&gt;(x: Box&lt;dyn Debug + &#39;a&gt;) {
   |                              - `x` is a reference that is only valid in the function body
LL |     static_val(x); //~ ERROR cannot infer
   |     ^^^^^^^^^^^^^ `x` escapes the function body here

error: aborting due to previous error
</pre></div>



<a name="130214283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130214283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130214283">(Jul 24 2018 at 14:24)</a>:</h4>
<p>nice</p>



<a name="130236258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236258">(Jul 24 2018 at 20:46)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> can you clarify 'grody'?</p>



<a name="130236269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236269">(Jul 24 2018 at 20:46)</a>:</h4>
<p>"hacky" I guess</p>



<a name="130236271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236271">(Jul 24 2018 at 20:46)</a>:</h4>
<p>I'm still torn though on the best way</p>



<a name="130236273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236273">(Jul 24 2018 at 20:46)</a>:</h4>
<p>tbh I didn't fully understand what you wrote</p>



<a name="130236287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236287">(Jul 24 2018 at 20:46)</a>:</h4>
<p>I guess it relied on <code>to_string</code> inserting <code>'_#3r</code> regions with the actual region numbers?</p>



<a name="130236291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236291">(Jul 24 2018 at 20:46)</a>:</h4>
<p>or did I misunderstand what I was reading</p>



<a name="130236311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236311">(Jul 24 2018 at 20:47)</a>:</h4>
<p>I think I still favor some kind of hacked up variant on pretty-printing that knows about this desire to control how regions are printed out</p>



<a name="130236428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236428">(Jul 24 2018 at 20:49)</a>:</h4>
<p>No, you're right, it looks for the <code>'_#</code> and removes that, leaving the <code>&amp;</code> that it looks for.</p>



<a name="130236432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236432">(Jul 24 2018 at 20:49)</a>:</h4>
<p>Just wasn't familiar with the word.</p>



<a name="130236529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236529">(Jul 24 2018 at 20:50)</a>:</h4>
<p>another option we <em>could</em> do is to add a new kind of region variant</p>



<a name="130236544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236544">(Jul 24 2018 at 20:50)</a>:</h4>
<p>but that seems like it will have pretty broad impact</p>



<a name="130236572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236572">(Jul 24 2018 at 20:50)</a>:</h4>
<p>hmm an interesting thing is that all the regions in this case are going to be <code>ReVar</code></p>



<a name="130236573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236573">(Jul 24 2018 at 20:50)</a>:</h4>
<p>well I guess that doesn't help so much</p>



<a name="130236589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236589">(Jul 24 2018 at 20:51)</a>:</h4>
<p>but I was imaginging you could have some kind of callback for how to print <code>ReVar</code></p>



<a name="130236631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236631">(Jul 24 2018 at 20:51)</a>:</h4>
<p>It seems like some enhancements to the pretty printer seem to be the preferred approach.</p>



<a name="130236636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236636">(Jul 24 2018 at 20:51)</a>:</h4>
<p>but I guess that's no different than having a callback for all regions</p>



<a name="130236642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236642">(Jul 24 2018 at 20:51)</a>:</h4>
<p>I think that is my preferred approach so far, what do you think?</p>



<a name="130236658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236658">(Jul 24 2018 at 20:52)</a>:</h4>
<p>somehow controlling the string as it is created seems nicer than trying to match on it afterwards</p>



<a name="130236699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130236699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130236699">(Jul 24 2018 at 20:52)</a>:</h4>
<p>Yeah, that seems worth a shot.</p>



<a name="130267957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130267957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130267957">(Jul 25 2018 at 10:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> so I'm looking at the categorization code</p>



<a name="130267962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130267962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130267962">(Jul 25 2018 at 10:47)</a>:</h4>
<p>I've changed in my PR some more logic to use it</p>



<a name="130267964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130267964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130267964">(Jul 25 2018 at 10:47)</a>:</h4>
<p>it is producing this diff, which seems suboptimal</p>



<a name="130267965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130267965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130267965">(Jul 25 2018 at 10:47)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="gd">---- [ui (nll)] ui/lifetime-errors/ex2c-push-inference-variable.rs stdout ----</span>
<span class="gh">diff of stderr:</span>

5          |             ^^^
6
7       error[E0623]: lifetime mismatch
<span class="gd">-         --&gt; $DIR/ex2c-push-inference-variable.rs:17:5</span>
<span class="gi">+         --&gt; $DIR/ex2c-push-inference-variable.rs:16:13</span>
9          |
10      LL | fn foo&lt;&#39;a, &#39;b, &#39;c&gt;(x: &amp;&#39;a mut Vec&lt;Ref&lt;&#39;b, i32&gt;&gt;, y: Ref&lt;&#39;c, i32&gt;) {
11         |                                   ------------      ------------ these two types are declared with different lifetimes...

12      LL |     let z = Ref { data: y.data };
<span class="gd">-       LL |     x.push(z); //~ ERROR lifetime mismatch</span>
<span class="gd">-          |     ^^^^^^^^^ ...but data from `y` flows into `x` here</span>
<span class="gi">+          |             ^^^^^^^^^^^^^^^^^^^^ ...but data from `y` flows into `x` here</span>
15
16      error: aborting due to previous error
</pre></div>



<a name="130268008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268008">(Jul 25 2018 at 10:48)</a>:</h4>
<p>Interesting.</p>



<a name="130268012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268012">(Jul 25 2018 at 10:48)</a>:</h4>
<p>I think this is because we have an assignment (from the aggregate)</p>



<a name="130268015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268015">(Jul 25 2018 at 10:48)</a>:</h4>
<p>and that is ranked higher than the call etc</p>



<a name="130268017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268017">(Jul 25 2018 at 10:48)</a>:</h4>
<p>I guess that's just adding a more specific category or changing the order?</p>



<a name="130268023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268023">(Jul 25 2018 at 10:49)</a>:</h4>
<p>I'm trying to think: I think that in general assignments from aggregates are unlikely to be good candidates</p>



<a name="130268029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268029">(Jul 25 2018 at 10:49)</a>:</h4>
<p>since they <em>tend</em> to "propagate" regions rather than constrain them</p>



<a name="130268031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268031">(Jul 25 2018 at 10:49)</a>:</h4>
<p>(there are exceptions of course)</p>



<a name="130268042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268042">(Jul 25 2018 at 10:49)</a>:</h4>
<p>I guess I could add a new category to detect this sort of case</p>



<a name="130268043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268043">(Jul 25 2018 at 10:49)</a>:</h4>
<p>I believe I added that because it was enough to make one of the previous tests in a PR work.</p>



<a name="130268045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268045">(Jul 25 2018 at 10:50)</a>:</h4>
<p>right</p>



<a name="130268090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268090">(Jul 25 2018 at 10:50)</a>:</h4>
<p>I think that was needed because the closure escape messages</p>



<a name="130268091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268091">(Jul 25 2018 at 10:50)</a>:</h4>
<p>were not triggering because they are tied to the category</p>



<a name="130268092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268092">(Jul 25 2018 at 10:50)</a>:</h4>
<p>I do wonder about that though</p>



<a name="130268093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268093">(Jul 25 2018 at 10:50)</a>:</h4>
<p>e.g., does the category really matter?</p>



<a name="130268096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268096">(Jul 25 2018 at 10:50)</a>:</h4>
<p>I guess it depends on the phrasing of the message</p>



<a name="130268098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268098">(Jul 25 2018 at 10:50)</a>:</h4>
<p>I guess that's the pain point with categories. We can re-order them, but that could have lots of consequences to tests, or add more specific ones, but then it just becomes a mechanism for special casing things.</p>



<a name="130268115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268115">(Jul 25 2018 at 10:51)</a>:</h4>
<p>it seems to me that this is somewhat inevitable</p>



<a name="130268155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268155">(Jul 25 2018 at 10:52)</a>:</h4>
<p>I've been messing with the pretty printing, it's something.</p>



<a name="130268156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268156">(Jul 25 2018 at 10:52)</a>:</h4>
<p>I mean ultimately we're dealing in heuristics, so yeah... it's gonna be fine-tunning and relying on having a decent set of tests</p>



<a name="130268159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268159">(Jul 25 2018 at 10:52)</a>:</h4>
<p>which we... may or may not have :)</p>



<a name="130268717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268717">(Jul 25 2018 at 11:09)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> ok I'm studying this a bit more, I may have an idea for an alternative to sorting the constraints :)</p>



<a name="130268725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130268725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130268725">(Jul 25 2018 at 11:09)</a>:</h4>
<p>Oh?</p>



<a name="130269009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269009">(Jul 25 2018 at 11:18)</a>:</h4>
<p>grr, idk, it's tricky. It feels like what we want to do somehow is to classify not so much as "boring or interesting" but to try and classify the <em>role</em> that each constriant plays along the path. That is, some constraints serve to "forward" one side or the other along. But somewhere in the middle comes at least one constraint that serves to put the one side in tension with the other. How to distinguish that, I'm still not entirely sure. One thing I was looking at is whether it might be interesting to look at locations with multiple constraints associated with them. e.g., looking at the example I gave above, the path is</p>
<div class="codehilite"><pre><span></span>DEBUG 2018-07-25T11:12:01Z: rustc_mir::borrow_check::nll::region_infer::error_reporting: best_blame_constraint: path=[
    &quot;ConstraintIndex(27): (\&#39;_#3r: \&#39;_#14r) due to All&quot;,
    &quot;ConstraintIndex(1): (\&#39;_#14r: \&#39;_#7r) due to Boring(bb0[5])&quot;,
    &quot;ConstraintIndex(9): (\&#39;_#7r: \&#39;_#6r) due to Boring(bb0[5])&quot;,
    &quot;ConstraintIndex(8): (\&#39;_#6r: \&#39;_#18r) due to Boring(bb0[5])&quot;,
    &quot;ConstraintIndex(11): (\&#39;_#18r: \&#39;_#8r) due to Boring(bb0[6])&quot;,
    &quot;ConstraintIndex(10): (\&#39;_#8r: \&#39;_#17r) due to Interesting(bb0[6])&quot;,
    &quot;ConstraintIndex(16): (\&#39;_#17r: \&#39;_#21r) due to Boring(bb0[11])&quot;,
    &quot;ConstraintIndex(21): (\&#39;_#21r: \&#39;_#10r) due to Interesting(bb0[12])&quot;,
    &quot;ConstraintIndex(19): (\&#39;_#10r: \&#39;_#20r) due to Interesting(bb0[12])&quot;,
    &quot;ConstraintIndex(13): (\&#39;_#20r: \&#39;_#16r) due to Boring(bb0[9])&quot;,
    &quot;ConstraintIndex(5): (\&#39;_#16r: \&#39;_#13r) due to Interesting(bb0[2])&quot;,
    &quot;ConstraintIndex(24): (\&#39;_#13r: \&#39;_#2r) due to All&quot;
]
</pre></div>


<p>where <code>bb0[12]</code> is the thing I want us to select.</p>



<a name="130269016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269016">(Jul 25 2018 at 11:18)</a>:</h4>
<p>but of course other things appear more than once (eg., <code>bb0[5]</code>, albeit in a "boring" capacity)</p>



<a name="130269027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269027">(Jul 25 2018 at 11:19)</a>:</h4>
<p>in this particular case, the region <code>#20</code> acts as this sort of 'intermediary'</p>



<a name="130269071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269071">(Jul 25 2018 at 11:20)</a>:</h4>
<p>it is equated with <code>#10</code> and <code>#13</code></p>



<a name="130269085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269085">(Jul 25 2018 at 11:21)</a>:</h4>
<p>I'm trying to think how we can distinguish these "carriers" actions from the others...</p>



<a name="130269088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269088">(Jul 25 2018 at 11:21)</a>:</h4>
<p>idk.</p>



<a name="130269144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269144">(Jul 25 2018 at 11:22)</a>:</h4>
<p>I'm not sure. I kind of follow what you're suggesting.</p>



<a name="130269226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269226">(Jul 25 2018 at 11:24)</a>:</h4>
<p>what I was getting at with the 'multiple constraints' at one location is this</p>



<a name="130269240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269240">(Jul 25 2018 at 11:25)</a>:</h4>
<p>if you look at the MIR, you have things like</p>
<div class="codehilite"><pre><span></span>_1 = _4
</pre></div>


<p>or</p>
<div class="codehilite"><pre><span></span>_1 = &amp;mut _4
</pre></div>


<p>which basically "propagate" regions from <code>_4</code> into <code>_1</code></p>



<a name="130269251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269251">(Jul 25 2018 at 11:25)</a>:</h4>
<p>the call in constrast is </p>
<div class="codehilite"><pre><span></span>_0 = call Vec::push(_1, _2)
</pre></div>


<p>which, in this case, takes the vector <code>_1</code> type and relates it to the element type <code>_2</code></p>



<a name="130269255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269255">(Jul 25 2018 at 11:25)</a>:</h4>
<p>so another way to look at is "where did the regions come from"</p>



<a name="130269295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269295">(Jul 25 2018 at 11:26)</a>:</h4>
<p>ah, hmm, interesting. So for example in this case we have an edge from <code>_10</code> to <code>_20</code> -- where <code>_10</code> appears in one of the call arguments</p>



<a name="130269300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269300">(Jul 25 2018 at 11:26)</a>:</h4>
<p>and another edge from <code>_20</code> to <code>_16</code>, which appears in another argument</p>



<a name="130269303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269303">(Jul 25 2018 at 11:26)</a>:</h4>
<p><em>that</em> seems like the interesting bit</p>



<a name="130269306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269306">(Jul 25 2018 at 11:26)</a>:</h4>
<p>the <code>_20</code> itself appears in the type arguments of <code>Vec::push</code></p>



<a name="130269310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269310">(Jul 25 2018 at 11:27)</a>:</h4>
<p>e.g., the fully elaborated thing is like <code>Vec::push::&lt;&amp;'_20r u32&gt;(_1, _2)</code></p>



<a name="130269324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269324">(Jul 25 2018 at 11:27)</a>:</h4>
<p>so it feels like if we can look for locations where there is a path from one operand to another</p>



<a name="130269328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269328">(Jul 25 2018 at 11:27)</a>:</h4>
<p><em>that</em> is an interesting spot</p>



<a name="130269679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130269679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130269679">(Jul 25 2018 at 11:36)</a>:</h4>
<p>I'll give it a try</p>



<a name="130275269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275269">(Jul 25 2018 at 13:29)</a>:</h4>
<p>ok <span class="user-mention" data-user-id="116107">@David Wood</span> I went a different direction but it works well for my test case</p>



<a name="130275273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275273">(Jul 25 2018 at 13:29)</a>:</h4>
<p>now I have to see how much it messes up other stuff :P</p>



<a name="130275288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275288">(Jul 25 2018 at 13:29)</a>:</h4>
<p>here is the code I added, which explains the reasoning:</p>
<div class="codehilite"><pre><span></span>        // To find the best span to cite, we first try to look for the
        // final constraint that is interesting and where the `sup` is
        // not unified with the ultimate target region. The reason
        // for this is that we have a chain of constraints that lead
        // from the source to the target region, something like:
        //
        //    &#39;0: &#39;1 (&#39;0 is the source)
        //    &#39;1: &#39;2
        //    &#39;2: &#39;3
        //    &#39;3: &#39;4
        //    &#39;4: &#39;5
        //    &#39;5: &#39;6 (&#39;6 is the target)
        //
        // Some of those regions are unified with `&#39;6` (in the same
        // SCC).  We want to screen those out. After that point, the
        // &quot;closest&quot; constraint we have to the end is going to be the
        // most likely to be the point where the value escapes -- but
        // we still want to screen for an &quot;interesting&quot; point to
        // highlight (e.g., a call site or something).
        let target_scc = self.constraint_sccs.scc(target_region);
        let best_choice = (0..path.len()).rev().find(|&amp;i| {
            let constraint = &amp;self.constraints[path[i]];

            let constraint_sup_scc = self.constraint_sccs.scc(constraint.sup);
            if constraint_sup_scc == target_scc {
                return false;
            }

            match categorized_path[i].0 {
                ConstraintCategory::Boring =&gt; false,
                _ =&gt; true,
            }
        });
</pre></div>



<a name="130275430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275430">(Jul 25 2018 at 13:32)</a>:</h4>
<p>so far it seems strictly better</p>



<a name="130275450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275450">(Jul 25 2018 at 13:33)</a>:</h4>
<p>e.g., </p>
<div class="codehilite"><pre><span></span> error: unsatisfied lifetime constraints
<span class="gd">-  --&gt; $DIR/propagate-approximated-fail-no-postdom.rs:55:21</span>
<span class="gi">+  --&gt; $DIR/propagate-approximated-fail-no-postdom.rs:57:13</span>
    |
 LL |         |_outlives1, _outlives2, _outlives3, x, y| {
    |          ----------              ---------- lifetime `&#39;2` appears in this argument
    |          |
    |          lifetime `&#39;1` appears in this argument
<span class="gd">-LL |             // Only works if &#39;x: &#39;y:</span>
<span class="gd">-LL |             let p = x.get(); //~ ERROR</span>
<span class="gd">-   |                     ^^^^^^^ argument requires that `&#39;1` must outlive `&#39;2`</span>
<span class="gi">+...</span>
<span class="gi">+LL |             demand_y(x, y, p) //~ ERROR</span>
<span class="gi">+   |             ^^^^^^^^^^^^^^^^^ argument requires that `&#39;1` must outlive `&#39;2`</span>
</pre></div>



<a name="130275463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275463">(Jul 25 2018 at 13:33)</a>:</h4>
<p>definitely seems better to highlight the call to <code>demand_y</code> and not the call to <code>x.get()</code></p>



<a name="130275510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275510">(Jul 25 2018 at 13:34)</a>:</h4>
<p>another example</p>
<div class="codehilite"><pre><span></span> error[E0621]: explicit lifetime required in the type of `y`
<span class="gd">-  --&gt; $DIR/issue-40288-2.rs:16:31</span>
<span class="gi">+  --&gt; $DIR/issue-40288-2.rs:17:9</span>
    |
 LL | fn lifetime_transmute_slice&lt;&#39;a, T: ?Sized&gt;(x: &amp;&#39;a T, y: &amp;T) -&gt; &amp;&#39;a T {
    |                                                      - consider changing the type of `y` to `&amp;&#39;a T`
 ...
<span class="gd">-LL |         let slice: &amp;mut [_] = &amp;mut out;</span>
<span class="gd">-   |                               ^^^^^^^^ lifetime `&#39;a` required</span>
<span class="gi">+LL |         slice[0] = y;</span>
<span class="gi">+   |         ^^^^^^^^^^^^ lifetime `&#39;a` required</span>
</pre></div>



<a name="130275535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275535">(Jul 25 2018 at 13:35)</a>:</h4>
<p>heehee, this is an extreme one</p>
<div class="codehilite"><pre><span></span> error[E0623]: lifetime mismatch
<span class="gd">-  --&gt; $DIR/ex3-both-anon-regions-3.rs:11:33</span>
<span class="gi">+  --&gt; $DIR/ex3-both-anon-regions-3.rs:12:5</span>
    |
 LL | fn foo(z: &amp;mut Vec&lt;(&amp;u8,&amp;u8)&gt;, (x, y): (&amp;u8, &amp;u8)) {
<span class="gd">-   |                     ---         ^       --- these two types are declared with different lifetimes...</span>
<span class="gd">-   |                                 |</span>
<span class="gd">-   |                                 ...but data flows into `z` here</span>
<span class="gi">+   |                     ---                 --- these two types are declared with different lifetimes...</span>
<span class="gi">+LL |     z.push((x,y)); //~ ERROR lifetime mismatch</span>
<span class="gi">+   |     ^^^^^^^^^^^^^ ...but data flows into `z` here</span>
</pre></div>



<a name="130275542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275542">(Jul 25 2018 at 13:35)</a>:</h4>
<p>ok, enough, this seems good.</p>



<a name="130275553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275553">(Jul 25 2018 at 13:35)</a>:</h4>
<p>also, that last message would benefit from the "give names to things" treatment I think</p>



<a name="130275557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275557">(Jul 25 2018 at 13:35)</a>:</h4>
<p>but that's the old <code>NiceRegionError</code> code</p>



<a name="130275560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275560">(Jul 25 2018 at 13:35)</a>:</h4>
<p>ought to be fwd-ported</p>



<a name="130275564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275564">(Jul 25 2018 at 13:35)</a>:</h4>
<p>or maybe the new errors are even getting just better</p>



<a name="130275699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275699">(Jul 25 2018 at 13:38)</a>:</h4>
<p>I assume then by "give names to things" you don't mean the "has type" label from this PR?</p>



<a name="130275821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275821">(Jul 25 2018 at 13:41)</a>:</h4>
<p>no I mean the existing logic, in this case</p>



<a name="130275825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275825">(Jul 25 2018 at 13:41)</a>:</h4>
<p>e.g.,</p>



<a name="130275843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275843">(Jul 25 2018 at 13:41)</a>:</h4>
<div class="codehilite"><pre><span></span> error[E0623]: lifetime mismatch
+  --&gt; $DIR/ex3-both-anon-regions-3.rs:12:5
    |
 LL | fn foo(z: &amp;mut Vec&lt;(&amp;u8,&amp;u8)&gt;, (x, y): (&amp;u8, &amp;u8)) {
+   |                     ---                 --- let&#39;s call the lifetimes of these references `&#39;1` and `&#39;2`, respectively
+LL |     z.push((x,y)); //~ ERROR lifetime mismatch
+   |     ^^^^^^^^^^^^^ data with lifetime `&#39;2` flows into `&#39;1` here
</pre></div>



<a name="130275869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275869">(Jul 25 2018 at 13:42)</a>:</h4>
<p>something like that, idk</p>



<a name="130275887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275887">(Jul 25 2018 at 13:42)</a>:</h4>
<p>in any case "data flows into" is not very good</p>



<a name="130275894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275894">(Jul 25 2018 at 13:42)</a>:</h4>
<p>also, I do think we want to kind of consolidate our terminology. e.g., this talks about "data flowing"</p>



<a name="130275898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275898">(Jul 25 2018 at 13:42)</a>:</h4>
<p>but I think other errors have other terms</p>



<a name="130275899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275899">(Jul 25 2018 at 13:42)</a>:</h4>
<p>we're too diverse</p>



<a name="130275914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275914">(Jul 25 2018 at 13:43)</a>:</h4>
<p>anyway if you're curious <a href="https://github.com/rust-lang/rust/pull/52488/commits/0d918a8575cfc7d7ec97b86e87c11e023ac3a37c" target="_blank" title="https://github.com/rust-lang/rust/pull/52488/commits/0d918a8575cfc7d7ec97b86e87c11e023ac3a37c">here is the commit, including the affected tests</a></p>



<a name="130275960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275960">(Jul 25 2018 at 13:44)</a>:</h4>
<p>That's good.</p>



<a name="130275963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275963">(Jul 25 2018 at 13:44)</a>:</h4>
<p>this is an interesting one: <a href="https://github.com/rust-lang/rust/pull/52488/commits/0d918a8575cfc7d7ec97b86e87c11e023ac3a37c#diff-6ae66f5f7de7aa4de7eb84da3a8cad33" target="_blank" title="https://github.com/rust-lang/rust/pull/52488/commits/0d918a8575cfc7d7ec97b86e87c11e023ac3a37c#diff-6ae66f5f7de7aa4de7eb84da3a8cad33">https://github.com/rust-lang/rust/pull/52488/commits/0d918a8575cfc7d7ec97b86e87c11e023ac3a37c#diff-6ae66f5f7de7aa4de7eb84da3a8cad33</a></p>



<a name="130275968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275968">(Jul 25 2018 at 13:44)</a>:</h4>
<p>your new "data escapes" error triggers now</p>



<a name="130275971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275971">(Jul 25 2018 at 13:44)</a>:</h4>
<p>whereas it didn't before</p>



<a name="130275994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130275994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130275994">(Jul 25 2018 at 13:44)</a>:</h4>
<p>oh hmm <a href="https://github.com/rust-lang/rust/pull/52488/commits/0d918a8575cfc7d7ec97b86e87c11e023ac3a37c#diff-718caa2ac9a63a2e0197ac83499c18e0" target="_blank" title="https://github.com/rust-lang/rust/pull/52488/commits/0d918a8575cfc7d7ec97b86e87c11e023ac3a37c#diff-718caa2ac9a63a2e0197ac83499c18e0">https://github.com/rust-lang/rust/pull/52488/commits/0d918a8575cfc7d7ec97b86e87c11e023ac3a37c#diff-718caa2ac9a63a2e0197ac83499c18e0</a> is the one sort of regression I guess</p>



<a name="130276010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276010">(Jul 25 2018 at 13:45)</a>:</h4>
<p>the problem seems to be the span of the <code>return</code> as much as anything</p>



<a name="130276031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276031">(Jul 25 2018 at 13:45)</a>:</h4>
<p>but I guess more to the point the "return" is considered a kind of interesting statement but <em>really</em> the <em>cast</em> would be more interesting</p>



<a name="130276036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276036">(Jul 25 2018 at 13:46)</a>:</h4>
<p>i.e., the thing that produced the value being returned</p>



<a name="130276104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276104">(Jul 25 2018 at 13:46)</a>:</h4>
<p>I'm struggling with this pretty printer work. I've got a way to generalize it such that I'll eventually be able to create a <code>RegionInferencePrinterContext</code> that overrides the correct functions. But trying to generalize it piece by piece is a struggle.</p>



<a name="130276122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276122">(Jul 25 2018 at 13:47)</a>:</h4>
<p>:/</p>



<a name="130276126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276126">(Jul 25 2018 at 13:47)</a>:</h4>
<p>it <em>could</em> be the wrong path</p>



<a name="130276129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276129">(Jul 25 2018 at 13:47)</a>:</h4>
<p>although I suspect it's "just" that the code is a terrible mess</p>



<a name="130276130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276130">(Jul 25 2018 at 13:47)</a>:</h4>
<p>i.e., if the pretty printer were nicer, it would work</p>



<a name="130276135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276135">(Jul 25 2018 at 13:47)</a>:</h4>
<p>but of course we have to work with the code we have :)</p>



<a name="130276187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276187">(Jul 25 2018 at 13:48)</a>:</h4>
<p>how exactly are you trying to introduce this context?</p>



<a name="130276481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276481">(Jul 25 2018 at 13:54)</a>:</h4>
<p>I've made a trait that is a <code>PrintContext</code>, then going to make a <code>DebugPrintContext</code>, <code>DisplayPrintContext</code> to handle the current cases. The existing <code>print_debug</code> function would just create a <code>DebugPrintContext</code> and then do the printing with that.</p>
<p>Printing would be handled by implementing <code>PrintWithContext&lt;DebugPrintContext&gt;</code> (with the appropriate context) - so you'd have a implementation of <code>print_with_context(..)</code> for every context. That lets us introduce new contexts that handle how individual types are printed. I was then going to use specialization to fallback to a <code>Print</code> trait that prints without the need for a context.</p>
<p>I think it would work relatively alright, such that we could create a <code>RegionInferPrintContext</code> that overrides just one of the functions that the trait requires which will control the region naming. For <code>RegionInferPrintContext</code> specifically, the default impl would fallback to <code>DisplayPrintContext</code> rather than <code>Print</code>.</p>
<p>I don't know if this is a decent approach or not.</p>



<a name="130276498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276498">(Jul 25 2018 at 13:55)</a>:</h4>
<p>Since it's all set up in repos, I'm just trying to change the underlying traits it impls without needing to change the actual printing code.</p>



<a name="130276517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276517">(Jul 25 2018 at 13:55)</a>:</h4>
<p>Which is mostly working, but I'm left with a couple unsatisfied trait bounds that I haven't quite worked out.</p>



<a name="130276595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276595">(Jul 25 2018 at 13:56)</a>:</h4>
<p>(at this point I've not split the existing context into two, because I wanted to just get it using the <code>PrintWithContext</code> types first with one giant debug + display context that was there before).</p>



<a name="130276615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130276615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130276615">(Jul 25 2018 at 13:57)</a>:</h4>
<p>(after changing to two contexts, I will need to modify the print code slightly but that shouldn't be too bad).</p>



<a name="130277297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277297">(Jul 25 2018 at 14:10)</a>:</h4>
<p>sounds sort of neat</p>



<a name="130277314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277314">(Jul 25 2018 at 14:10)</a>:</h4>
<p>my usual complaint about that code has been that I want <code>{:?}</code> and <code>-Zverbose</code> to be equivalent</p>



<a name="130277317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277317">(Jul 25 2018 at 14:10)</a>:</h4>
<p>which is totally unrelated ;)</p>



<a name="130277330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277330">(Jul 25 2018 at 14:11)</a>:</h4>
<p>if you want some help with the bounds feel free to push commit etc</p>



<a name="130277352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277352">(Jul 25 2018 at 14:11)</a>:</h4>
<p>meanwhile i'm debating what to do about dyn-trait-underscore. I wonder if we should ignore <code>Return</code> -- but that seems problematic</p>



<a name="130277360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277360">(Jul 25 2018 at 14:11)</a>:</h4>
<p>the problem in this case is that there are <em>two</em> casts, one after the other esssentially</p>



<a name="130277421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277421">(Jul 25 2018 at 14:12)</a>:</h4>
<p>anyway I guess we can land as is and improve</p>



<a name="130277528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277528">(Jul 25 2018 at 14:14)</a>:</h4>
<p>That's probably a decent idea.</p>



<a name="130277579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277579">(Jul 25 2018 at 14:15)</a>:</h4>
<p>I was also considering ignoring things with multi-line spans</p>



<a name="130277581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277581">(Jul 25 2018 at 14:15)</a>:</h4>
<p>total hack though :)</p>



<a name="130277680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277680">(Jul 25 2018 at 14:17)</a>:</h4>
<p>I think I've gotten past that bounds issue.</p>



<a name="130277683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277683">(Jul 25 2018 at 14:17)</a>:</h4>
<p>One step closer.</p>



<a name="130277688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277688">(Jul 25 2018 at 14:18)</a>:</h4>
<p>It's way too warm here.</p>



<a name="130277971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277971">(Jul 25 2018 at 14:22)</a>:</h4>
<p>heh, we're sitting by the harbor now, nice breeze...</p>



<a name="130277974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130277974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130277974">(Jul 25 2018 at 14:22)</a>:</h4>
<p>just come to an Island :P</p>



<a name="130283520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130283520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130283520">(Jul 25 2018 at 15:50)</a>:</h4>
<p>This pretty printer definitely needs tidied up, but I don't know it's the effort is worth it to remove that ugly string manipulation. There's _so_ much here. </p>
<p>I've got it separated out into two contexts - debug and display - that have the same code in them but that can now be changed per-context. I can remove all the display-specific code from the debug context, etc. Both impls are still constructed together through the macros though, so I can't start separating things out into easier to grok modules.</p>



<a name="130285501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285501">(Jul 25 2018 at 16:17)</a>:</h4>
<p>I think I had envisioned something far hackier</p>



<a name="130285516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285516">(Jul 25 2018 at 16:17)</a>:</h4>
<p>I took a break for a bit and ran the tests instead of just doing check.</p>



<a name="130285525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285525">(Jul 25 2018 at 16:17)</a>:</h4>
<p>Regressed in tons with this attempted refactor.</p>



<a name="130285528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285528">(Jul 25 2018 at 16:17)</a>:</h4>
<p>e.g.,</p>
<div class="codehilite"><pre><span></span>scoped_thread_local! {
    REGION_CALLBACK: ....
}
</pre></div>



<a name="130285575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285575">(Jul 25 2018 at 16:18)</a>:</h4>
<p>and then in the Display impl for <code>Region</code></p>



<a name="130285603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285603">(Jul 25 2018 at 16:18)</a>:</h4>
<p>something like</p>
<div class="codehilite"><pre><span></span>REGION_CALLBACK.with(|c| if let Some(c) = c {
    c(..)
} else {
    // existing code
})
</pre></div>



<a name="130285612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285612">(Jul 25 2018 at 16:18)</a>:</h4>
<p>I think <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/util/ppaux.rs#L517-L523" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/util/ppaux.rs#L517-L523">this is where the regions are numbered now</a>.</p>



<a name="130285639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285639">(Jul 25 2018 at 16:19)</a>:</h4>
<p>ah, yes, that's where it does the regions like <code>for&lt;'r&gt; fn(&amp;'r u32)</code></p>



<a name="130285642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285642">(Jul 25 2018 at 16:19)</a>:</h4>
<p>that...could probably just stay the same I guess?</p>



<a name="130285675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285675">(Jul 25 2018 at 16:19)</a>:</h4>
<p>Hmm... I'll need to take a fresh look at this.</p>



<a name="130285678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285678">(Jul 25 2018 at 16:20)</a>:</h4>
<p>I was imagining invoking the hook here <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/util/ppaux.rs#L733-L738" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/util/ppaux.rs#L733-L738">https://github.com/rust-lang/rust/blob/master/src/librustc/util/ppaux.rs#L733-L738</a></p>



<a name="130285742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285742">(Jul 25 2018 at 16:20)</a>:</h4>
<p>it sounds to me like you may have reached the point where it makes sense to stop and consider</p>



<a name="130285759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285759">(Jul 25 2018 at 16:20)</a>:</h4>
<p>hard to say; as you say, it's clear that this code could be nicer</p>



<a name="130285764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285764">(Jul 25 2018 at 16:20)</a>:</h4>
<p>but it does feel like a tar pit</p>



<a name="130285941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130285941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130285941">(Jul 25 2018 at 16:23)</a>:</h4>
<p>I'm not sure. I've pushed my attempted refactor to another branch so it's not completely lost but I don't think that's the way to go.</p>



<a name="130286023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286023">(Jul 25 2018 at 16:24)</a>:</h4>
<p>I'll give something like you suggested a shot.</p>



<a name="130286140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286140">(Jul 25 2018 at 16:26)</a>:</h4>
<p>Though, not exactly sure how to do that with <code>scoped_thread_local!</code>.</p>



<a name="130286727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286727">(Jul 25 2018 at 16:35)</a>:</h4>
<p>oh, that's something we use in rustc, I kind of forget how it works though</p>



<a name="130286731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286731">(Jul 25 2018 at 16:35)</a>:</h4>
<p>it lets you set a value just for a time</p>



<a name="130286813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286813">(Jul 25 2018 at 16:37)</a>:</h4>
<p>you can just do it with <code>thread_local</code> too</p>



<a name="130286828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286828">(Jul 25 2018 at 16:37)</a>:</h4>
<p>we could even sort of hardcode the behavior</p>



<a name="130286842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286842">(Jul 25 2018 at 16:37)</a>:</h4>
<p>e.g., <code>thread_local! { static highlight_region: Cell&lt;Option&lt;ty::RegionVid&gt;&gt; = ... }</code></p>



<a name="130286848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286848">(Jul 25 2018 at 16:37)</a>:</h4>
<p>and then just open code what we want</p>



<a name="130286851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286851">(Jul 25 2018 at 16:37)</a>:</h4>
<p>into the ppaux code</p>



<a name="130286896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130286896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130286896">(Jul 25 2018 at 16:38)</a>:</h4>
<p>(if that is set to <code>Some</code>, then we would print <code>'_</code> for all regions except the highlight-region)</p>



<a name="130288002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130288002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130288002">(Jul 25 2018 at 16:58)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Alright, let me clarify this:</p>
<p>I should put a <code>scoped_thread_local!(..)</code> in the <code>ppaux</code> module that has the <code>RegionVid</code> of the region we wish to highlight. In order for that function to generate the region name, it'll also need the <code>counter: &amp;mut usize</code>.</p>
<p>In the new function from this PR, I can call <code>highlight_region.set(&amp;(region, counter), || { ... })</code> and in the closure, call the function that will create the pretty printed type. Then, I store that string outside of the closure so that I can return it for the rest of the error handling.</p>
<p>In the <code>ppaux</code> module, at the start of the <code>define_print!</code> for <code>RegionKind</code>, I can use <code>highlight_region.with(|(region, counter)| ..)</code> to compute the new region name in place of the existing logic, and get that outside of the closure to return that from there. To do this, I'll need to check if the <code>RegionKind</code> we're pretty printing is the <code>RegionVid</code> in our scoped thread local variable, somehow.</p>
<p>Is that roughly it?</p>



<a name="130288316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130288316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130288316">(Jul 25 2018 at 17:04)</a>:</h4>
<p>Going to take a break, will likely return to this in a few hours.</p>



<a name="130289121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130289121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130289121">(Jul 25 2018 at 17:17)</a>:</h4>
<p>I'd probably just use a regular <code>thread_local</code> in this case</p>



<a name="130289131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130289131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130289131">(Jul 25 2018 at 17:17)</a>:</h4>
<p>something like:</p>
<div class="codehilite"><pre><span></span><span class="n">thread_local</span><span class="o">!</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">static</span><span class="w"> </span><span class="n">HIGHLIGHT_REGION</span>: <span class="nc">Cell</span><span class="o">&lt;</span><span class="nb">Option</span><span class="o">&lt;</span><span class="p">(</span><span class="n">RegionVid</span><span class="p">,</span><span class="w"> </span><span class="kt">usize</span><span class="p">)</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Cell</span>::<span class="n">new</span><span class="p">(</span><span class="nb">None</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="130289207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130289207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130289207">(Jul 25 2018 at 17:18)</a>:</h4>
<p>then I would add a helper like</p>
<div class="codehilite"><pre><span></span><span class="n">with_highlight_region</span><span class="o">&lt;</span><span class="n">R</span><span class="o">&gt;</span><span class="p">(</span><span class="n">r</span>: <span class="nc">RegionVid</span><span class="p">,</span><span class="w"> </span><span class="n">counter</span>: <span class="kt">usize</span><span class="p">,</span><span class="w"> </span><span class="n">op</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">FnOnce</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="nc">R</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">R</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">HIGHLIGHT_REGION</span><span class="p">.</span><span class="n">with</span><span class="p">(</span><span class="o">|</span><span class="n">hr</span><span class="o">|</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">assert_eq</span><span class="o">!</span><span class="p">(</span><span class="n">hr</span><span class="p">.</span><span class="n">get</span><span class="p">(),</span><span class="w"> </span><span class="nb">None</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="n">hr</span><span class="p">.</span><span class="n">set</span><span class="p">(</span><span class="nb">Some</span><span class="p">((</span><span class="n">r</span><span class="p">,</span><span class="w"> </span><span class="n">counter</span><span class="p">)));</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">op</span><span class="p">();</span><span class="w"></span>
<span class="w">        </span><span class="n">hr</span><span class="p">.</span><span class="n">set</span><span class="p">(</span><span class="nb">None</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="n">r</span><span class="w"></span>
<span class="w">    </span><span class="p">})</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="130289246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130289246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130289246">(Jul 25 2018 at 17:19)</a>:</h4>
<p>and at the start of the fn you can do</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">get_highlight_region</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="nb">Option</span><span class="o">&lt;</span><span class="p">(</span><span class="n">RegionVid</span><span class="p">,</span><span class="w"> </span><span class="kt">usize</span><span class="p">)</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">HIGHLIGHT_REGION</span><span class="p">.</span><span class="n">with</span><span class="p">(</span><span class="o">|</span><span class="n">hr</span><span class="o">|</span><span class="w"> </span><span class="n">hr</span><span class="p">.</span><span class="n">get</span><span class="p">())</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="130334735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130334735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130334735">(Jul 26 2018 at 10:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Alright, got that working. Pushed a commit with it. Interestingly, that didn't work for one or two tests with regressed to what we had pre-this PR.</p>



<a name="130335278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130335278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130335278">(Jul 26 2018 at 10:45)</a>:</h4>
<p>Yeah, it seems like in a handful of cases, the <code>fmt</code> function that I had to change to use <code>HIGHLIGHT_REGION</code> doesn't get called.</p>



<a name="130337982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130337982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130337982">(Jul 26 2018 at 11:44)</a>:</h4>
<p>huh</p>



<a name="130337985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130337985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130337985">(Jul 26 2018 at 11:44)</a>:</h4>
<p>that's pushed <span class="user-mention" data-user-id="116107">@David Wood</span> to the PR?</p>



<a name="130338012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338012">(Jul 26 2018 at 11:45)</a>:</h4>
<p>It is.</p>



<a name="130338074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338074">(Jul 26 2018 at 11:46)</a>:</h4>
<p>The top two diffs for tests in this commit: <a href="https://github.com/rust-lang/rust/pull/52648/commits/70ed4e2c9789c1f8d81549ab4e68b03fcae24578" target="_blank" title="https://github.com/rust-lang/rust/pull/52648/commits/70ed4e2c9789c1f8d81549ab4e68b03fcae24578">https://github.com/rust-lang/rust/pull/52648/commits/70ed4e2c9789c1f8d81549ab4e68b03fcae24578</a></p>



<a name="130338104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338104">(Jul 26 2018 at 11:47)</a>:</h4>
<p>I believe it happens on types where by default (without any of the variations on this PR) it would just print <code>&amp;i32</code> rather than <code>&amp;'_#3r i32</code> or something like that.</p>



<a name="130338108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338108">(Jul 26 2018 at 11:47)</a>:</h4>
<p>I'm not sure what case causes that.</p>



<a name="130338195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338195">(Jul 26 2018 at 11:49)</a>:</h4>
<p>I see, yes, I think if the highlight region is set we will want to suppress or alter some of that logic</p>



<a name="130338198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338198">(Jul 26 2018 at 11:49)</a>:</h4>
<p>let me see..</p>



<a name="130338250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338250">(Jul 26 2018 at 11:50)</a>:</h4>
<p>weird it <em>seems</em> to always print the region <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/util/ppaux.rs#L1022-L1030" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/util/ppaux.rs#L1022-L1030">here</a></p>



<a name="130338252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338252">(Jul 26 2018 at 11:50)</a>:</h4>
<p>Yeah, I found that.</p>



<a name="130338253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338253">(Jul 26 2018 at 11:50)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> in those examples, the variable's type is <code>&amp;u32</code>?</p>



<a name="130338267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338267">(Jul 26 2018 at 11:51)</a>:</h4>
<p>Yes, I said <code>i32</code> as an example.</p>



<a name="130338346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338346">(Jul 26 2018 at 11:53)</a>:</h4>
<p>can you print out what string they <em>do</em> get?</p>



<a name="130338352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338352">(Jul 26 2018 at 11:53)</a>:</h4>
<p>it might be nice to also print the <code>{:?}</code> output</p>



<a name="130338386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338386">(Jul 26 2018 at 11:54)</a>:</h4>
<p>IIRC it is just <code>&amp;u32</code> without any lifetimes/region at all.</p>



<a name="130338503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338503">(Jul 26 2018 at 11:56)</a>:</h4>
<p>can you try with <code>-Zverbose</code>?</p>



<a name="130338875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130338875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130338875">(Jul 26 2018 at 12:05)</a>:</h4>
<p>Let me check, just building after addressing some of the comments on the MR.</p>



<a name="130339362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339362">(Jul 26 2018 at 12:16)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Works as before with <code>-Z verbose</code>.</p>



<a name="130339369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339369">(Jul 26 2018 at 12:17)</a>:</h4>
<p>ok so the region <em>is</em> there</p>



<a name="130339375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339375">(Jul 26 2018 at 12:17)</a>:</h4>
<p>(Also, is there a reason I can't see ppaux logging with <code>RUST_LOG=rustc::util</code>?)</p>



<a name="130339378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339378">(Jul 26 2018 at 12:17)</a>:</h4>
<p>not that I know of</p>



<a name="130339382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339382">(Jul 26 2018 at 12:17)</a>:</h4>
<p>oh wait</p>



<a name="130339424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339424">(Jul 26 2018 at 12:18)</a>:</h4>
<p>you need to customize <a href="https://github.com/davidtwco/rust/blob/70ed4e2c9789c1f8d81549ab4e68b03fcae24578/src/librustc/util/ppaux.rs#L740-L741" target="_blank" title="https://github.com/davidtwco/rust/blob/70ed4e2c9789c1f8d81549ab4e68b03fcae24578/src/librustc/util/ppaux.rs#L740-L741">this code here</a></p>



<a name="130339425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339425">(Jul 26 2018 at 12:18)</a>:</h4>
<p>If I have that in the <code>RUST_LOG</code> and <code>-Z verbose</code> then I get a core dump.</p>



<a name="130339427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339427">(Jul 26 2018 at 12:18)</a>:</h4>
<p>I'm sort of surprised it ever works :)</p>



<a name="130339428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339428">(Jul 26 2018 at 12:18)</a>:</h4>
<p>this line in particular looks problematic: <a href="https://github.com/davidtwco/rust/blob/70ed4e2c9789c1f8d81549ab4e68b03fcae24578/src/librustc/util/ppaux.rs#L782" target="_blank" title="https://github.com/davidtwco/rust/blob/70ed4e2c9789c1f8d81549ab4e68b03fcae24578/src/librustc/util/ppaux.rs#L782">https://github.com/davidtwco/rust/blob/70ed4e2c9789c1f8d81549ab4e68b03fcae24578/src/librustc/util/ppaux.rs#L782</a></p>



<a name="130339503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339503">(Jul 26 2018 at 12:20)</a>:</h4>
<p>Giving it a go now having changed the <code>is_verbose</code> check.</p>



<a name="130339743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339743">(Jul 26 2018 at 12:25)</a>:</h4>
<p>ok</p>



<a name="130339900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339900">(Jul 26 2018 at 12:29)</a>:</h4>
<p>Doing <code>if is_verbose &amp;&amp; get_highlight_region().is_none()</code> makes it stop doing <code>has_type</code> when <code>-Z verbose</code> - now it never does it.</p>



<a name="130339929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339929">(Jul 26 2018 at 12:30)</a>:</h4>
<p>I guess it should be <code>if is_verbose || get_highlight_region().is_some()</code></p>



<a name="130339980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339980">(Jul 26 2018 at 12:30)</a>:</h4>
<p>that would what I expect, yes :)</p>



<a name="130339984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339984">(Jul 26 2018 at 12:30)</a>:</h4>
<p>I blame the heat.</p>



<a name="130339986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339986">(Jul 26 2018 at 12:30)</a>:</h4>
<p>It's very warm.</p>



<a name="130339989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130339989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130339989">(Jul 26 2018 at 12:30)</a>:</h4>
<p>Thinking is hard when warm.</p>



<a name="130340000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130340000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130340000">(Jul 26 2018 at 12:31)</a>:</h4>
<p>xD</p>



<a name="130340382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130340382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130340382">(Jul 26 2018 at 12:38)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> updated that PR, third time lucky.</p>



<a name="130340603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130340603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130340603">(Jul 26 2018 at 12:42)</a>:</h4>
<p>left one more nit :) but the results are looking good</p>



<a name="130340606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130340606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130340606">(Jul 26 2018 at 12:42)</a>:</h4>
<p>I definitely think I like this better than the text manipulation</p>



<a name="130341485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341485">(Jul 26 2018 at 12:58)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Not sure I follow what your nit is asking for, particularly the second comment.</p>



<a name="130341499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341499">(Jul 26 2018 at 12:58)</a>:</h4>
<p>My goal would be that we print (e.g.) <code>&amp;Foo&lt;'_, '1&gt;</code></p>



<a name="130341509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341509">(Jul 26 2018 at 12:58)</a>:</h4>
<p>I think that this PR will print...something different now, maybe <code>&amp;Foo&lt;'1&gt;</code></p>



<a name="130341517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341517">(Jul 26 2018 at 12:58)</a>:</h4>
<p>(we should add a test for this, I can help with that if you want)</p>



<a name="130341536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341536">(Jul 26 2018 at 12:59)</a>:</h4>
<p>what I was suggesting is that — in highlight mode — <code>RegionVid</code> would return either <code>'1</code> or <code>'_</code></p>



<a name="130341555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341555">(Jul 26 2018 at 12:59)</a>:</h4>
<p>Ah, you want <code>'_</code> in the type parameters but <code> </code> elsewhere?</p>



<a name="130341560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341560">(Jul 26 2018 at 12:59)</a>:</h4>
<p>then, in the TyRef ppaux code, we would look and see if the pretty-printed version of our region is <code>"'_"</code> and — if so — not print it</p>



<a name="130341563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341563">(Jul 26 2018 at 12:59)</a>:</h4>
<p>right now we look for <code>""</code></p>



<a name="130341575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341575">(Jul 26 2018 at 12:59)</a>:</h4>
<p>but <code>&amp;u32</code> and <code>&amp;'_ u32</code> should always be equivalent</p>



<a name="130341622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341622">(Jul 26 2018 at 13:00)</a>:</h4>
<blockquote>
<p>Ah, you want <code>'_</code> in the type parameters but <code> </code> elsewhere?</p>
</blockquote>
<p>right :)</p>



<a name="130341664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341664">(Jul 26 2018 at 13:00)</a>:</h4>
<p>Alright, that all makes sense.</p>



<a name="130341855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341855">(Jul 26 2018 at 13:03)</a>:</h4>
<p>if you have a build handy, maybe try this test?</p>
<div class="codehilite"><pre><span></span><span class="cp">#![feature(nll)]</span><span class="w"></span>
<span class="cp">#![allow(warnings)]</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;b</span><span class="p">,</span><span class="w"> </span><span class="n">T</span>: <span class="na">&#39;a</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="na">&#39;b</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">x</span>: <span class="kp">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="n">y</span>: <span class="kp">&amp;</span><span class="na">&#39;b</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">gimme</span><span class="p">(</span><span class="n">_</span>: <span class="nc">impl</span><span class="w"> </span><span class="k">for</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;b</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;c</span><span class="o">&gt;</span><span class="w"> </span><span class="nb">FnOnce</span><span class="p">(</span><span class="o">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;b</span><span class="p">,</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;c</span><span class="p">,</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;b</span><span class="p">,</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">gimme</span><span class="p">(</span><span class="o">|</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">y</span><span class="o">|</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="130341894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341894">(Jul 26 2018 at 13:04)</a>:</h4>
<p>I think that would show the types in question</p>



<a name="130341914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341914">(Jul 26 2018 at 13:04)</a>:</h4>
<p>also, instead of "free region requires that <code>'1</code> must outlive <code>'2</code>", maybe we should just say "here, <code>'1</code> must outlive <code>'2</code>"</p>



<a name="130341928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341928">(Jul 26 2018 at 13:05)</a>:</h4>
<p>or just "requires <code>'1</code> to outlive <code>'2</code>"</p>



<a name="130341932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130341932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130341932">(Jul 26 2018 at 13:05)</a>:</h4>
<p>something like that</p>



<a name="130344487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130344487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130344487">(Jul 26 2018 at 13:43)</a>:</h4>
<p>Alright, pushed changes that make that case work fine and remove the "free region" part of messages.</p>



<a name="130344512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130344512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130344512">(Jul 26 2018 at 13:43)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="130344595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130344595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130344595">(Jul 26 2018 at 13:45)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> <span class="emoji emoji-1f3c2" title="snowboarder">:snowboarder:</span> nice!</p>



<a name="130344769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130344769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130344769">(Jul 26 2018 at 13:47)</a>:</h4>
<p>looks great</p>



<a name="130344874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130344874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> csmoe <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130344874">(Jul 26 2018 at 13:49)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://github.com/rust-lang/rust/issues/52708" target="_blank" title="https://github.com/rust-lang/rust/issues/52708">https://github.com/rust-lang/rust/issues/52708</a> this issue seems to only involve some clean-up and matches my level, may I take care of it?</p>



<a name="130344954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130344954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130344954">(Jul 26 2018 at 13:50)</a>:</h4>
<p><span class="user-mention" data-user-id="116773">@csmoe</span> certainly, leave a comment</p>



<a name="130345916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130345916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130345916">(Jul 26 2018 at 14:08)</a>:</h4>
<p>Fixed the tidy error.</p>



<a name="130355164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130355164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130355164">(Jul 26 2018 at 16:15)</a>:</h4>
<p>Tests passed.</p>



<a name="130403425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types/near/130403425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52533-region-err-fully-elaborated-types.html#130403425">(Jul 27 2018 at 11:16)</a>:</h4>
<p>Rebased this, needs another r+ after tests pass.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>